<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
	function checkForm(){
		var ddTypeId=$("#ddTypeId").val();
		var ddValue=$("#ddValue").val();
		if(ddTypeId==null||ddTypeId==""){
			$("#error").html("请选择数据字典类别！");
			return false;
		}
		if(ddValue==null||ddValue==""){
			$("#error").html("数据字典值不能为空！");
			return false;
		}
		return true;
	}
</script>
<div class="data_list">
	<div class="data_content" >
		<form class="form-horizontal" action="dataDic!save" method="post" onsubmit="return checkForm()">
		  <div class="control-group">
		    <label class="control-label" style="padding-left: 200px;">数据字典类别：</label>
		    <div class="controls">
		      <select id="ddTypeId" name="dataDic.ddTypeId">
				<option value="">请选择数据字典类别...</option>
				<c:forEach var="dataDicType" items="${dataDicTypeList }">
					<option value="${dataDicType.ddTypeId }" ${dataDicType.ddTypeId==dataDic.ddTypeId?'selected':'' }>${dataDicType.ddTypeName }</option>
				</c:forEach>
			 </select>
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" style="padding-left: 200px;">数据字典值：</label>
		    <div class="controls">
		      <input type="text" id="ddValue" name="dataDic.ddValue" value="${dataDic.ddValue }"/>
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" style="padding-left: 200px;">数据字典描述：</label>
		    <div class="controls">
		      <textarea rows="5" cols="10" id="ddDesc" name="dataDic.ddDesc">${dataDic.ddDesc }</textarea>
		    </div>
		  </div>
		  <div class="control-group">
		    <div class="controls" style="padding-left: 200px;">
		      <input type="hidden" id="ddId" name="ddId" value="${dataDic.ddId }"/><input type="submit" class="btn btn-primary" value="保存"/>&nbsp;&nbsp;
		      <button class="btn btn-primary" type="button" onclick="javascript:history.back()">返回</button>&nbsp;&nbsp;<font id="error" color="red">${error }</font>
		    </div>
		  </div>
		</form>
		
	</div>
</div>
